package com.xuecheng.manage_cms.controller;

import com.xuecheng.api.sys.dictionary.SystemDictionaryControllerApi;
import com.xuecheng.framework.domain.system.SysDictionary;
import com.xuecheng.manage_cms.service.SystemDictionaryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/sys/dictionary")
public class SystemDictionaryController implements SystemDictionaryControllerApi {
    @Resource
    private SystemDictionaryService systemDictionaryServiceImpl;
    /**
     * 根据type查询数据字典
     *
     * @param type 类型
     * @return 结果
     */
    @Override
    @GetMapping("/get/{type}")
    public SysDictionary findByType(@PathVariable("type") String type) {
        return systemDictionaryServiceImpl.findByType(type);
    }
}
